package ch.janotta.slawo.ultraquest.types;

import java.util.ArrayList;
import java.util.List;

public class Party {
  private Area location;
  private List<Character> characters;
  private List<Quest> quests;
  private int closeCombatStrength;
  private int rangedCombatStrength;
  private int mixedCombatStrength;
  private int fame;
  private int honor;

  public Party() {
    characters = new ArrayList<Character>();
  }

  public Area getLocation() {
    return location;
  }

  public void setLocation(Area location) {
    this.location = location;
  }

  public List<Character> getCharacters() {
    return characters;
  }

  public void setCharacters(List<Character> characters) {
    this.characters = characters;
  }

  public void addCharacter(Character c) {
    characters.add(c);
  }

  public void removeCharacter(Character c) {
    characters.remove(c);
  }

  public int getCloseCombatStrength() {
    return closeCombatStrength;
  }

  public void setCloseCombatStrength(int closeCombatStrength) {
    this.closeCombatStrength = closeCombatStrength;
  }

  public int getRangedCombatStrength() {
    return rangedCombatStrength;
  }

  public void setRangedCombatStrength(int rangedCombatStrength) {
    this.rangedCombatStrength = rangedCombatStrength;
  }

  public int getMixedCombatStrength() {
    return mixedCombatStrength;
  }

  public void setMixedCombatStrength(int mixedCombatStrength) {
    this.mixedCombatStrength = mixedCombatStrength;
  }

  public int getFame() {
    return fame;
  }

  public void setFame(int fame) {
    this.fame = fame;
  }

  public int getHonor() {
    return honor;
  }

  public void setHonor(int honor) {
    this.honor = honor;
  }

  public void updateCombatStrengths() {
    int close = 0;
    int ranged = 0;
    int mixed = 0;
    for (Character character : characters) {
      close += character.getMaxCloseCombatValue();
      ranged += character.getMaxRangedCombatValue();
      mixed += character.getMaxCombinedCombatValue();
    }
    closeCombatStrength = close;
    rangedCombatStrength = ranged;
    mixedCombatStrength = mixed;
  }
}
